<?php

namespace App\Http\Controllers\api\health;

use App\Http\Controllers\Controller;
use App\Models\Article;
use Illuminate\Http\Request;

class HealthController extends Controller
{
    /**
     * @小程序百科文章展示页面
     * @user 刘璇
     * @method get
     * @url https://www.healthcare.com/api/lx/health_index
     * @data
     * @return \Illuminate\Http\Response
     */
    public function healthIndex(){
        $data=Article::get();
        return response()->json(['code'=>'200','data'=>$data,'message'=>'获取成功']);
    }

    /**
     * @小程序百科文章详情展示页面
     * @user 刘璇
     * @method get
     * @url https://www.healthcare.com/api/lx/health_detail
     * @data
     * @return \Illuminate\Http\Response
     */
    public function healthDetail(Request $request){
        $id=$request->get('id');
        $data=Article::where('id',$id)->first();
        return response()->json(['code'=>'200','data'=>$data,'message'=>'获取成功']);
    }

}
